﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ThreeByte.ActiveDeck.AddIn.Controls.Wizard.Pages;
using System.Diagnostics;

namespace ThreeByte.ActiveDeck.AddIn.Controls.Wizard
{
    /// <summary>
    /// Interaction logic for NavigationFrame.xaml
    /// </summary>
    public partial class NavigationFrame : UserControl
    {
        public NavigationFrame() {
            InitializeComponent();
        }

        private void HomeExecuted(object sender, ExecutedRoutedEventArgs e) {
            MainNavigationFrame.Navigate(new StartPage());
        }

        private void GotoChooseThemeExecuted(object sender, ExecutedRoutedEventArgs e) {
            MainNavigationFrame.Navigate(new ChooseThemePage());
        }

        private void GotoCreateContentExecuted(object sender, ExecutedRoutedEventArgs e) {
            MainNavigationFrame.Navigate(new CreateContentPage());
        }

        private void GotoAudienceResponseExecuted(object sender, ExecutedRoutedEventArgs e) {
            MainNavigationFrame.Navigate(new EnterQuestionPage());
        }

        private void GotoAudiencePhotosExecuted(object sender, ExecutedRoutedEventArgs e) {
            MainNavigationFrame.Navigate(new SelectPhotoPage());
        }

        private void GotoAudienceVideosExecuted(object sender, ExecutedRoutedEventArgs e) {
            MainNavigationFrame.Navigate(new SelectVideoPage());
        }

        private void GotoMirrorSlidesExecuted(object sender, ExecutedRoutedEventArgs e) {
            MainNavigationFrame.Navigate(new CreateContentPage());
        }

        private void GotoReviewAndPublishExecuted(object sender, ExecutedRoutedEventArgs e) {
            MainNavigationFrame.Navigate(new ReviewPage());
        }
        
        private void GotoReviewExecuted(object sender, ExecutedRoutedEventArgs e) {
            MainNavigationFrame.Navigate(new ReviewPage());
        }

        private void GotoPublishExecuted(object sender, ExecutedRoutedEventArgs e) {
            MainNavigationFrame.Navigate(new PublishPage());
        }

        private void GotoSummaryExecuted(object sender, ExecutedRoutedEventArgs e) {
            MainNavigationFrame.Navigate(new SummaryPage());
        }

        private void HelpExecuted(object sender, ExecutedRoutedEventArgs e) {
            //#7331 - Navigate to tutorials webpage for now
            try {
                string webAddress = "http://activedeck.com/Support/TutorialsResources.aspx";
                ProcessStartInfo ps = new ProcessStartInfo(webAddress);
                ps.UseShellExecute = true;
                Process.Start(ps);
            } catch(Exception) {
               
            }
            e.Handled = true;
        }
    }
}
